package twelfth.对象序列化;

import java.io.Serializable;

public class 类中的name属性不希望被序列化 implements Serializable {
    private transient String name;//此属性不被序列化
    private  int age;//此属性被序列化

    public 类中的name属性不希望被序列化(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person: " +
                "name='" + name + '\'' +
                ", age=" + age ;
    }
}
